import http from "./request";

// home/recommendProduct/list
// 分页查询推荐
export const homeRNewProductList = (
  params: IHomeHostParams
): PRES<IHomeProductList> => {
  return http.get("home/recommendProduct/list", { params });
};

// home/recommendProduct/update/sort/{id}
// 修改推荐排序
export const recProUpdateSort = (id: number, sort: number): PRES<IReqSort> =>
  http.post(`home/recommendProduct/update/sort/${id}?sort=${sort}`);

//   home/recommendProduct/delete
// 批量删除推荐
export const homeRecProDel = (ids: number[]): PRES<IReqSort> => {
  return http.post(`home/recommendProduct/delete?ids=${ids}`);
};

//   home/recommendProduct/update/recommendStatus
// 批量修改推荐状态
export const homeRecUpDtaRecStatus = (
  ids: number[],
  recommendStatus: number
): PRES<IReqSort> =>
  http.post(
    `home/recommendProduct/update/recommendStatus?ids=${ids}&recommendStatus=${recommendStatus}`
  );

// home/recommendProduct/create
// 添加首页推荐
export const homeRecProCreate = (params: newProductModel[]): PRES<IReqSort> => {
  return http.post(`home/recommendProduct/create`, params);
};
